s = input('请输入一个字符串(只包括字母、数字、空格):')
res = True
if s.isspace()is False:
    mid1 = s.lower()
    mid2 = mid1.replace(' ','')
    if mid2.isalnum()is False:
        print('含有非法字符，验证失败')
    else:
        begin = 0
        end = len(mid2) - 1
        while begin < end:
            if mid2[begin] != mid2[end]:
                res = False
                break
            begin += 1
            end -= 1
            print(res)
        else:
            print(res)